package com.tyx.chargingpile.vo;

import com.tyx.chargingpile.Enum.HttpServiceExceptionEume;

/**
 *  接口返回模型
 */
public class RespondResult {

    public RespondResult(){

    }

    public RespondResult(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public RespondResult(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static RespondResult ERROR(HttpServiceExceptionEume exceptionEume){
        return new RespondResult(exceptionEume.getCode(),exceptionEume.getMsg());
    }

    public static RespondResult OK(Object data){
        return new RespondResult(HttpServiceExceptionEume.OK.getCode(),HttpServiceExceptionEume.OK.getMsg(),data);
    }


    /**
     * 业务代码
     */
    private String code;

    /**
     * 返回消息
     */
    private String msg;

    /**
     * 返回内容
     */
    private Object data;
    /** 业务代码 */
    public String getCode() {
        return code;
    }

    /** 业务代码 */
    public void setCode(String code) {
        this.code = code;
    }

    /** 返回消息 */
    public String getMsg() {
        return msg;
    }

    /** 返回消息 */
    public void setMsg(String msg) {
        this.msg = msg;
    }

    /** 返回内容 */
    public Object getData() {
        return data;
    }

    /** 返回内容 */
    public void setData(Object data) {
        this.data = data;
    }
}
